class cCountry
{
	String name;
	int owner = -1;
	int armies = 1;
	int continent;
	int id;
	int[] limits;
	int[] collisionRect;
	
	int cardImage;
	int cardOwner = -1;
	boolean usedCard = false;
	
	public final static int NONE_SELECTED = -1;	
	static int selectedCountry = NONE_SELECTED;
	static int defendingCountry = NONE_SELECTED;
	
	int regroupableArmies = 0;
	
	static int[] continentArmies;
	
	public final static int RECT_X = 0;
	public final static int RECT_Y = RECT_X + 1;
	public final static int RECT_W = RECT_Y + 1;
	public final static int RECT_H = RECT_W + 1;
	
	public cCountry(String _name , int cont, int own, int[] lims, int[] colRect, int cI, int Id)
	{
		name = _name;
		setOwner(own);
		continent = cont;
		limits = lims;
		collisionRect = colRect;
		collisionRect[RECT_X] += INGAME.VIEWPORT_X;
		collisionRect[RECT_Y] += INGAME.VIEWPORT_Y;
		cardImage = cI;
		id = Id;
		continentArmies = new int[COUNTRY_INFO.TOTAL_CONTINENTS];
	}
	
	public String getName()
	{
		return name;
	}

	public int getArmies()
	{
		return armies;
	}
	
	public int getOwner()
	{
		return owner;
	}
	
	public int getId()
	{
		return id;
	}
	
	public int getContinent()
	{
		return continent;
	}
	
	public void setOwner(int newOwner)
	{
		if(owner != -1 && cGame.tegPlayers[owner].ownedCountries > 0)
			cGame.tegPlayers[owner].ownedCountries--;
		cGame.tegPlayers[newOwner].ownedCountries++;
		
		owner = newOwner;
	}
	
	public boolean limitsWith(int countryId)
	{
		for(int i = 0; i < limits.length; i++)
		{
			if(limits[i] == countryId)
				return true;
		}
		
		return false;
	}
}